package com.zerdoor.service.impl;

import com.zerdoor.dao.RaceOrderDao;
import com.zerdoor.service.RaceOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by xiaoji on 2015/1/13.
 */
@Service
public class RaceOrderServiceImpl implements RaceOrderService {

    @Autowired
    private RaceOrderDao raceOrderDao;
    @Override
    public Map<String, Object> getRaceOrderById(int raceId,int userId) {

        Map<String, Object> map = new HashMap<String, Object>();
        map.put("raceId",raceId);
        map.put("userId",userId);
        return raceOrderDao.getRaceOrderById(map);
    }

    @Override
    public void addOrderWin(Map<String, Object> map) throws Exception {
        raceOrderDao.addOrderWin(map);
    }

    @Override
    public void updateOrderRaceStatus(int raceId) throws Exception {
        raceOrderDao.updateOrderRaceStatus(raceId);
    }
}
